package com.guess.study.designpattern.factory.factorymethod.reflect.client;

import com.guess.study.designpattern.factory.factorymethod.product.ConcreteProductA;
import com.guess.study.designpattern.factory.factorymethod.product.ConcreteProductB;
import com.guess.study.designpattern.factory.factorymethod.product.Product;
import com.guess.study.designpattern.factory.factorymethod.reflect.factory.ConcreteCreator;
import com.guess.study.designpattern.factory.factorymethod.reflect.factory.Creator;

/**
 * Created by tianran on 2019-06-10.
 */
public class Client {
    public static void main(String[] args) {
        Creator creator = new ConcreteCreator();

        Product productA = creator.createProduct(ConcreteProductA.class);
        productA.doSomething();
        productA.doAnything();

        Product productB = creator.createProduct(ConcreteProductB.class);
        productB.doSomething();
        productB.doAnything();
    }
}
